<?php
set_time_limit(0);
include '../c/config.php';
  
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);

$sql="SELECT DISTINCT(uid) FROM `d5` where ishas is NULL limit 0,50 ";
$query=$mysqli->query($sql);
while ($list=$query->fetch_assoc()) {
   // var_dump($list);
   // echo "<br>";
    $sql="SELECT id FROM `uinfo` WHERE `uid` = '".$list['uid']."' limit 0,1 ";
    $queryCheck=$mysqli->query($sql);
    if($queryCheck->num_rows>0){
       //$getId=$queryCheck->fetch_assoc();
       //var_dump($getId);
       //echo "<br>";
      
       $mysqli->query("UPDATE `d5` SET `ishas` = '1' WHERE  `uid` = '".$list['uid']."' ");
    }else{
       $mysqli->query("UPDATE `d5` SET `ishas` = '9' WHERE  `uid` = '".$list['uid']."' ");

    }


}
echo rand(1,9);

 
$mysqli->close();

 

?>
<script type="text/javascript">
    window.setTimeout(function(){
         window.location.reload();
    }, 100);

</script>